*Does a competent leader make a good friend? - Laustsen & Petersen: Study 2

*---------------------------------------------------RECODING OF VARIABLES-------------------------------------------------------*

*Creates variable for choice of captain.
generate captain = .
replace captain = 1 if Q12 == 1.
replace captain = 1 if BV == 1.
replace captain = 1 if Q36 == 1.
replace captain = 1 if Q38 == 1.
replace captain = 0 if Q12 == 2.
replace captain = 0 if BV == 2.
replace captain = 0 if Q36 == 2.
replace captain = 0 if Q38 == 2.
label define captainLB 0 "Non-Dominant"  1 "Dominant"
label values captain  captainLB

*Creates variable for choice of cabin mate.
generate cabin = .
replace cabin = 1 if Q14 == 1.
replace cabin = 1 if CA == 1.
replace cabin = 1 if Q35 == 1.
replace cabin = 1 if Q37 == 1.
replace cabin = 0 if Q14 == 2.
replace cabin = 0 if CA == 2.
replace cabin = 0 if Q35 == 2.
replace cabin = 0 if Q37 == 2.
label define cabinLB 0 "Non-Dominant"  1 "Dominant"
label values cabin cabinLB


*Creates context variable.
generate context =.
replace context = 0 if Q10 == 1.
replace context = 1 if BG == 1.
label define contextLB 0 "Storm" 1 "Pirate"
label values context contextLB


*Creates variable for ideology based on subjects' party choice.
*Recodiing of party choice variable
recode Q20 (10 11 12 = .), generate(party)
*Coding of original party choice variable: 
*1 = Socialdemokraterne; 2 = Radikale Venstre; 3 = Konservative; 4 = Socialistisk Folkeparti; 5 = Liberal Alliance; 6 = Kristendemokraterne; 7 = Dansk Folkeparti; 8 = Venstre; 9 = Enhedslisten
*Creates dichotomy for leftwing (coded 0) and rightwing parties (coded 1):
recode party (1 2 4 9 = 0) (3 5 6 7 8 = 1), generate(rightwing)


*Creates variable for subject sex
generate sex = Q23-1
label define sexLB 0 "female" 1 "male"
label values sex sexLB




*-----------------------------------------------------------ANALYSES-----------------------------------------------------------*
*Contextual and ideological effects on choice of captain and cabin mate (Table 1)
logit captain context rightwing, or
logit cabin context rightwing, or


*----------------ROBUSTNESS ANALYSES AND EXTRA ANALYSES REPORTED IN ONLINE SUPPLEMENTARY MATERIAL-----------------------------*
*Possible interaction between context and ideology (Table B.1)
logit captain i.context##i.rightwing, or
logit cabin i.context##i.rightwing, or

*Possible interaction between context and subject sex (Table C.1)
logit captain i.context##i.sex rightwing, or
logit cabin i.context##i.sex rightwing, or

*Possible main effect of subject sex (Table C.2).
logit captain context rightwing sex, or
logit cabin context rightwing sex, or






